#include "GameSystemManager.h"
#include "LoginSystem.h"
#include "Utility.hpp"
GameSystemManager::GameSystemManager()
{
	m_regSystem.clear();
}

GameSystemManager::~GameSystemManager()
{

}

bool GameSystemManager::InitSystemMgr()
{
	return RegGameSystem(LoginSystem::GetInstance());
}

void GameSystemManager::LogicRun()
{
	for (const auto [_, sys] : m_regSystem)
	{
		sys->LogicRun(0);
	}
}

bool GameSystemManager::RegGameSystem(GameSystem* _sys)
{
	if (m_regSystem.emplace(_sys->GetSystemType(), _sys).second)
	{
		return true;
	}
	LogPrint(LogType::ERR, "reg system fail,type:%d", _sys->GetSystemType());
	return false;
}

void GameSystemManager::LoadGlobalData()
{
}
